import Vue from "vue";
import VueRouter from "vue-router";
// import Home from "../views/Home.vue" 第一种方法

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Main",
    // component: Home, 第一种方法
    component: () => import("../views/Main.vue"), //第二种方法
    redirect:'/home',//重定向到主页
    children: [
      // {
      //   path: "home",
      //   name: "home",
      //   component: () => import("../views/home/index.vue"),
      // },
      // {
      //   path: "mall",
      //   name: "mall",
      //   component: () => import("../views/Mall/index.vue"),
      // },
      // {
      //   path: "user",
      //   name: "user",
      //   component: () => import("../views/User/index.vue"),
      // },
      // {
      //   path: "pageOne",
      //   name: "pageOne",
      //   component: () => import("../views/Other/PageOne.vue"),
      // },
      // {
      //   path: "pageTwo",
      //   name: "pageTwo",
      //   component: () => import("../views/Other/PageTwo.vue"),
      // },
    ],
  },
  {
    path:'/login',
    name:'login',
    component:() => import("../views/Login/index.vue")
  }
];
const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
